package thread;

public class ThreadDemo8 {
    public static void main(String[] args) {
        Thread t=new Thread(() ->{
            while (Thread.currentThread().isInterrupted()){
                System.out.println("这是一线程");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    break;
                }
            }

        });

        t.start();
        t.interrupt();


    }

}
